<!DOCTYPE html>
<html>
<head lang="en">
	<meta charset="UTF-8">
<title>图片轮换</title>
	<link rel="stylesheet" href="css/scroll.css">

</head>

<body>
<div class="scroll">
	<div id="num">
		<a href="#" onclick="switchPic('1.gif')">1</a>
		<a href="#" onclick="switchPic('2.gif')">2</a>
		<a href="#" onclick="switchPic('3.jpg')">3</a>
		<a href="#" onclick="switchPic('4.jpg')">4</a>
		<a href="#" onclick="switchPic('5.gif')">5</a>
	</div>
	<img src="images/1.gif" alt="图片" id="photo"/>
</div>
<script>
	function switchPic(name){
		var pic=document.getElementById("photo");
		var picPath="images/"+name;
		pic.setAttribute("src",picPath)
	}
</script>
</body>
</html>
